package com.yilin.medical.activity;

import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.AdapterView;
import android.widget.AdapterView.OnItemClickListener;
import android.widget.GridView;
import android.widget.ImageView;
import android.widget.TextView;

import com.yilin.medical.R;
import com.yilin.medical.adapter.GridAdapter;

/**
 * 会议首页
 * @author lijianqun
 *
 */
public class HuiYiHomeActivity extends BaseActivity implements OnItemClickListener{


	private GridView mGridViewHome;
	private Context context;
	//肿瘤,心血管
	int[] homeItemIds = { R.drawable.huiyi_home_zhongliu,
			R.drawable.huiyi_home_xinxueguan, R.drawable.huiyi_home_yanke,
			R.drawable.huiyi_home_xiaohua, R.drawable.huiyi_home_neifenmi,
			R.drawable.huiyi_home_more };

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentViewWithTitle(R.layout.activity_home_huiyi);
		context = this;
		initView();
		registener();
	}

	private void initView() {
		mGridViewHome = (GridView) findViewById(R.id.gv_home);
		mGridViewHome.setAdapter(new GridAdapter(context, homeItemIds));
		mTitle.getTitle().setText("会议");
	}

	private void registener() {
		mGridViewHome.setOnItemClickListener(this);
	}

	@Override
	public void onClick(View v) {
		super.onClick(v);
		switch (v.getId()) {

		default:
			break;
		}
	}
	
	@Override
	public void onItemClick(AdapterView<?> parent, View view, int position,
			long id) {

		Intent intent ;
		switch (position) {
		//TODO 需要修改
		case 0:
			//肿瘤
			intent = new Intent(context, HuiYiActivity.class);
			startActivity(intent);
			break;
		case 1:
			//心血管
			intent = new Intent(context, HuiYiActivity.class);
			startActivity(intent);
			break;
		case 2:
			//眼科
			intent = new Intent(context, HuiYiActivity.class);
			startActivity(intent);
			break;
		case 3:
			//消化
			intent = new Intent(context, HuiYiActivity.class);
			startActivity(intent);
			break;
		case 4:
			//内分泌
			intent = new Intent(context, HuiYiActivity.class);
			startActivity(intent);
			break;
		case 5:
			//更多
			intent = new Intent(context, HuiYiActivity.class);
			startActivity(intent);
			break;
		}
	
	}



}
